package com.zlq.cn.controller;


import com.zlq.cn.api.SignApiResult;
import com.zlq.cn.entity.Banner;
import com.zlq.cn.service.un.BannerService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author zhoucl
 * @since 2022-12-09
 */
@Api(tags = "轮播图")
@RestController
@RequestMapping("/api/common/banner")
public class BannerController {

    @Resource
    private BannerService bannerService;

    @ApiOperation("列表")
    @GetMapping("/list")
    public SignApiResult<List<Banner>> banner(Banner banner) {
        return SignApiResult.resultSuccess(bannerService.lambdaQuery()
                .eq(Banner::getProject, banner.getProject())
                .eq(Banner::getEnable, "1")
                .list());
    }

}

